const promise = new Promise((resolve, reject) => {
    console.log(1);

    setTimeout(() => {
        console.log('timeStart');
        resolve('success') // 将状态变更到rsolved，并且将之前的promise.then推入到当前的微任务
        console.log('timeEnd');
    }, 0)

    console.log(2);
})

promise.then(res => {
    console.log(res); 
})

console.log(4);

// 1 2 4 timeStart timeEnd success